package com.example.file.Controller;

import com.example.file.entity.Image;
import com.example.file.entity.SysDict;
import com.example.file.service.ImageService;
import com.example.file.service.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/up")
public class ImageController {

        @Autowired
        private ImageService imageService;

        @PostMapping("/ipaddress")
        public List<Image> uploadipaddress(String url) {
            Image image = imageService.uploadipaddress(url);
            List<Image> results = new ArrayList<>();
            results.add(image);
            return results;
        }
}
